def CalFac(l2 = []):
    a = 1;
    b = 1;
    l2.append(a)
    l2.append(b)
    while a+b < 1e6:
        c = a + b
        l2.append(c)
        a = b
        b = c
    return l2
ret = CalFac()
print(ret)

# 输入一个数字，找出距离这个数最近的斐波那契数
num = int(input('请输入一个整数: '))
min_diff = float('inf')
if(isinstance(num,(int))):
    for x in ret:
        diff = abs(num - x)
        if(diff < min_diff):
            min_diff = diff

print(min_diff)

    

